package com.yn.iotxiao;

import com.gitee.sunchenbin.mybatis.actable.manager.handler.StartUpHandler;
import com.yn.iotxiao.authorize.SecurityConfig;
import com.yn.iotxiao.config.InterceptorConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

@SpringBootApplication
@MapperScan({"com.yn.iotxiao.sql.mapper","com.gitee.sunchenbin.mybatis.actable.dao.*","com.yn.iotxiao.mapper"})
@ComponentScan(basePackages = {"com.yn.iotxiao.*","com.gitee.sunchenbin.mybatis.actable.manager.*"})
@Import({InterceptorConfig.class})
public class Application {

    public static void main(String[] args) {
//        SpringApplication.run(Application.class, args);
        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);
        // 容器中获取actable的核心处理类
        StartUpHandler bean =run.getBean(StartUpHandler.class, args);
        // 手动执行actable的建表方法
        bean.startHandler();
    }

}
